import {MongoTable} from "../db/MongoTable";
import {SqlBuilder} from "../db/SqlBuilder";
import {IRpcServer} from "../IHttpServer";


export class InnerRpc {

    /**
     * 当前在线的rpc进程列表
     * @type {Array}
     */
    static servers = Array<IRpcServer>();

    async getPid() {
        return process.pid
    }

    async delMongo(table: string, id: any) {
        let m = MongoTable.cacheMap.get(table);
        if (m) {
            m.delete(id);
        }
    }

    async delMysql(table: string, id: any) {
        let m = SqlBuilder.cacheMap.get(table);
        if (m) {
            m.delete(id);
        }
    }
}
